<!doctype html public "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
<html>
<head>
<title>
 Overview
</title>
<link rel ="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script>
function asd() {
	
		parent.document.title="LineStartResizeHandle.js Overview";
	
}
</script>
</head>
<body bgcolor="white" onload="asd();">

<!-- ========== START OF NAVBAR ========== -->
<a name="navbar_top"><!-- --></a>
<table border="0" width="100%" cellpadding="1" cellspacing="0">
<tr>
<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
<a name="navbar_top_firstrow"><!-- --></a>
<table border="0" cellpadding="0" cellspacing="3">
  <tr align="center" valign="top">
  
  
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a>&nbsp;</td>
  <td bgcolor="#FFFFFF" class="NavBarCell1Rev">	&nbsp;<font class="NavBarFont1Rev"><b>File</b></font>&nbsp;</td>
  

  <td bgcolor="#FFFFFF" class="NavBarCell1"> 	<font class="NavBarFont1">Class</font>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a>&nbsp;</td>
  </tr>
</table>
</td>
<td bgcolor="#EEEEFF" align="right" valign="top">
<em>
<b></b></em>
</td>
</tr>

<tr>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
&nbsp;PREV&nbsp;
&nbsp;NEXT</font></td>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
  <a href="index.html" target="_top"><b>FRAMES</b></a>  &nbsp;
&nbsp;<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
&nbsp;&nbsp;
<script>
  <!--
  if(window==top) {
    document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
  }
  //-->
</script>
<noscript>
<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
</noscript>
</font></td>
</tr>
</table>
<!-- =========== END OF NAVBAR =========== -->

<hr>
<center>
	
	   <h2>LineStartResizeHandle.js</h2>
	
</center>

	


<h4>Summary</h4>
<p>
	
		No overview generated for 'LineStartResizeHandle.js'<BR/><BR/>
	
</p>

<hr>



<!-- ========== METHOD SUMMARY =========== -->

<!-- ========== END METHOD SUMMARY =========== -->


        <pre class="sourceview"><span class="comment">/* This notice must be untouched at all times.

FreeGroup Draw2D 0.9.26
The latest version is available at
http://www.freegroup.de

Copyright (c) 2006 Andreas Herz. All rights reserved.
Created 5. 11. 2006 by Andreas Herz (Web: http://www.freegroup.de )

LICENSE: LGPL

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License (LGPL) as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA,
or see http://www.gnu.org/copyleft/lesser.html
*/</span>

<span class="comment">/**
 * 
 * <span class="attrib">@version</span> 0.9.26
 * <span class="attrib">@author</span> Andreas Herz
 * <span class="attrib">@constructor</span>
 * <span class="attrib">@param</span> {draw2d.Workflow} workflow The host canvas for this resize handle
 * <span class="attrib">@private</span>
 * <span class="attrib">@final</span>
 */</span>
draw2d.LineStartResizeHandle=<span class="reserved">function</span>(<span class="comment">/*:draw2d.Workflow*/</span> workflow)
{
  draw2d.ResizeHandle.call(<span class="reserved">this</span>,workflow,9);
  <span class="reserved">this</span>.setDimension(10,10);
  <span class="reserved">this</span>.setBackgroundColor(new  draw2d.Color(100,255,0));
  <span class="reserved">this</span>.setZOrder(10000);
};

draw2d.LineStartResizeHandle.<span class="reserved">prototype</span> = new draw2d.ResizeHandle();
<span class="comment">/** <span class="attrib">@private</span> **/</span>
draw2d.LineStartResizeHandle.<span class="reserved">prototype</span>.type=<span class="literal">"draw2d.LineStartResizeHandle"</span>;

<span class="comment">/**
 * Will be called after a drag and drop action.&lt;br&gt;
 * Sub classes can override this method to implement additional stuff. Don't forget to call
 * the super implementation via &lt;code&gt;Figure.prototype.onDragend.call(this);&lt;/code&gt;
 * <span class="attrib">@private</span>
 **/</span>
draw2d.LineStartResizeHandle.<span class="reserved">prototype</span>.onDragend = <span class="reserved">function</span>()
{
  <span class="comment">// A Connection glue at the corresponding port. Reset the position to the origin port</span>
  <span class="comment">// if we doesn't drop the ResizeHandle on a other port.</span>
  <span class="comment">//</span>
  <span class="reserved">if</span>(<span class="reserved">this</span>.workflow.currentSelection instanceof draw2d.Connection)
  {
     <span class="reserved">if</span>(<span class="reserved">this</span>.command!==null)
        <span class="reserved">this</span>.command.cancel();
  }
  <span class="comment">//</span>
  <span class="reserved">else</span>
  {
     <span class="comment">// An non draggable resizeHandle doesn't create a move/resize command.</span>
     <span class="comment">// This happens if the selected figure has set the "nonResizeable" flag.</span>
     <span class="comment">//</span>
     <span class="reserved">if</span>(<span class="reserved">this</span>.command!==null)
       <span class="reserved">this</span>.getWorkflow().getCommandStack().execute(<span class="reserved">this</span>.command);
  }
  <span class="reserved">this</span>.command = null;
};

<span class="comment">/**
 * Will be called if the drag and drop action beginns. You can return [false] if you
 * want avoid the that the figure can be move.
 * 
 * 
 * <span class="attrib">@param</span> {int} x The x position where the mouse has been clicked in the figure
 * <span class="attrib">@param</span> {int} y The y position where the mouse has been clicked in the figure
 * <span class="attrib">@type</span> boolean
 **/</span>
draw2d.LineStartResizeHandle.<span class="reserved">prototype</span>.onDragstart = <span class="reserved">function</span>(<span class="comment">/*:int*/</span> x, <span class="comment">/*:int*/</span> y)
{
  <span class="comment">// This happens if the selected figure has set the "nonResizeable" flag</span>
  <span class="comment">// In this case the ResizeHandle can't be dragged. =&gt; no resize</span>
  <span class="comment">//</span>
  <span class="reserved">if</span>(!<span class="reserved">this</span>.canDrag)
    <span class="reserved">return</span> false;

  <span class="reserved">this</span>.command = <span class="reserved">this</span>.workflow.currentSelection.createCommand(new draw2d.EditPolicy(draw2d.EditPolicy.MOVE));

  <span class="reserved">return</span> <span class="reserved">this</span>.command!==null;
};

<span class="comment">/**
 *
 * <span class="attrib">@private</span>
 **/</span>
draw2d.LineStartResizeHandle.<span class="reserved">prototype</span>.onDrag = <span class="reserved">function</span>()
{
  var oldX = <span class="reserved">this</span>.getX()
  var oldY = <span class="reserved">this</span>.getY();
  draw2d.Rectangle.<span class="reserved">prototype</span>.onDrag.call(<span class="reserved">this</span>);
  var diffX = oldX-<span class="reserved">this</span>.getX();
  var diffY = oldY-<span class="reserved">this</span>.getY();

  var objPos = <span class="reserved">this</span>.workflow.currentSelection.getStartPoint();

  var line = <span class="reserved">this</span>.workflow.currentSelection;
  line.setStartPoint(objPos.x-diffX, objPos.y-diffY);
  line.isMoving = true;
};

<span class="comment">/**
 * Resizehandle has been drop on a InputPort/OutputPort.
 * <span class="attrib">@private</span>
 **/</span>
draw2d.LineStartResizeHandle.<span class="reserved">prototype</span>.onDrop = <span class="reserved">function</span>(<span class="comment">/*: draw2d.Port*/</span> dropTarget)
{
  var line = <span class="reserved">this</span>.workflow.currentSelection;
  line.isMoving=false;

  <span class="comment">// The ResizeHandle of a Connection has been droped on a Port</span>
  <span class="comment">// This will enforce a ReconnectCommand</span>
  <span class="reserved">if</span>(line instanceof draw2d.Connection)
  {
     <span class="reserved">this</span>.command.setNewPorts(dropTarget, line.getTarget());
     <span class="reserved">this</span>.getWorkflow().getCommandStack().execute(<span class="reserved">this</span>.command);
  }
  <span class="reserved">this</span>.command = null;
};

</pre>
	<hr>



<!-- ========== START OF NAVBAR ========== -->
<a name="navbar_top"><!-- --></a>
<table border="0" width="100%" cellpadding="1" cellspacing="0">
<tr>
<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
<a name="navbar_top_firstrow"><!-- --></a>
<table border="0" cellpadding="0" cellspacing="3">
  <tr align="center" valign="top">
  
  
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a>&nbsp;</td>
  <td bgcolor="#FFFFFF" class="NavBarCell1Rev">	&nbsp;<font class="NavBarFont1Rev"><b>File</b></font>&nbsp;</td>
  

  <td bgcolor="#FFFFFF" class="NavBarCell1"> <font class="NavBarFont1">Class</font>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a>&nbsp;</td>
  </tr>
</table>
</td>
<td bgcolor="#EEEEFF" align="right" valign="top"><em>
<b></b></em>
</td>
</tr>

<tr>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
&nbsp;PREV&nbsp;
&nbsp;NEXT</font></td>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
  <a href="index.html" target="_top"><b>FRAMES</b></a>  &nbsp;
&nbsp;<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
&nbsp;&nbsp;
<script>
  <!--
  if(window==top) {
    document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
  }
  //-->
</script>
<noscript>
<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
</noscript>
</font></td>
</tr>
</table>
<!-- =========== END OF NAVBAR =========== -->

<hr>
<font size="-1">

</font>
<div class="jsdoc_ctime">Documentation generated by <a href="http://jsdoc.sourceforge.net/" target="_parent">JSDoc</a> on Mon Nov 14 13:45:39 2011</div>
</body>
</html>
